<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        //获取布局视口的大小  与设备独立像素宽度相同
        console.log(document.documentElement.clientWidth);

        // 获取视觉视口的大小
        // console.log(window.innerWidth);// IOS 手机
        // console.log(window.visualViewport.width);// android 手机    了解

        //

    </script>
</body>
</html>